package com.hzw.code

import android.app.Application
import com.blankj.utilcode.util.DeviceUtils
import com.hzw.code.api.Api
import com.hzw.code.api.UpdateApi
import com.hzw.code.net.*

/**
 *
 * @Author:         HuaZhongWei
 * @CreateDate:     2020/4/16 13:36
 *
 * @Description:
 *
 */
class App : Application() {

    override fun onCreate() {
        super.onCreate()

        HttpCreator.create(
            clazz = Api::class.java,
            isDebug = true,
            headers = arrayOf(
                HEADER_APP_ID to "3",
                HEADER_DEVICE_ID to "C2FCA24ABDB2B8D2F6E6F31BE39BC9D682F7DFAA",
                HEADER_PLATFORM to "android",
                HEADER_TIMESTAMP to (System.currentTimeMillis() / 1000L).toString(),
                HEADER_VERSION to "2",
                HEADER_TOKEN to "JdHPLdrKVQ1BWBzjlLpu90gpsIzw/Y+UeiUFK3nbzayE27CJAHk/7DDSawt5M9Cno85D/BWals4Rslu+kMjfyVBBtVC4jCFHQDYu1+JICQCqHaKB3P5b6aoprfMBis1JXaIRh9pgA1LmTwBLHhWcz7YjrOdrCrwvGHqiZmu3OB0="
            ),
            encrypt = {
                it
            }
        )

        HttpCreator.create(
            clazz = UpdateApi::class.java,
            isDebug = true,
            headers = arrayOf(
                HEADER_APP_ID to "3",
                HEADER_DEVICE_ID to "C2FCA24ABDB2B8D2F6E6F31BE39BC9D682F7DFAA",
                HEADER_PLATFORM to "android",
                HEADER_TIMESTAMP to (System.currentTimeMillis() / 1000L).toString(),
                HEADER_VERSION to "2",
                HEADER_TOKEN to "JdHPLdrKVQ1BWBzjlLpu90gpsIzw/Y+UeiUFK3nbzayE27CJAHk/7DDSawt5M9Cno85D/BWals4Rslu+kMjfyVBBtVC4jCFHQDYu1+JICQCqHaKB3P5b6aoprfMBis1JXaIRh9pgA1LmTwBLHhWcz7YjrOdrCrwvGHqiZmu3OB0="
            )
        )
    }
}